Skip to content

Conversation

rdunk
Copy link

@rdunk rdunk commented Jan 2, 2025

I have an application using [email protected] alongside @sveltejs/[email protected], it seems like the is_legacy check introduced in #13140 is failing (assuming legacy refers to <= Svelte 4) as the result of onMount.toString() includes a linebreak in the function body.

This PR modifies the regex to account for whitespace within the curly braces.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@teemingc
Copy link
Member

teemingc commented Jan 3, 2025

I can't reproduce the issue that you're describing. Can you open a new issue with a minimal reproduction?

@rdunk
Copy link
Author

rdunk commented Jan 3, 2025

I have a minimal repro here: https://github.com/rdunk/svelte-legacy-check-repro, but on further inspection it seems to only fail with the combination of [email protected], [email protected] and @sveltejs/[email protected]. Looking through release notes, perhaps Svelte 4 and the compatible version of the vite plugin (3.x) are incompatible with Vite 6?

Let me know if not and I'll open an issue and properly report.

@teemingc
Copy link
Member

teemingc commented Jan 3, 2025

Yeah, they're incompatible. I think you might need Svelte 5 and vite-plugin-svelte 4 to use Vite 6

@rdunk
Copy link
Author

rdunk commented Jan 3, 2025

OK, thanks for confirming. In that case I'll close this PR as I'm only able to reproduce when using Vite 6. Thanks for the help!

@rdunk rdunk closed this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants